<?php

/**
 * sfGuardUser form.
 *
 * @package    form
 * @subpackage sf_guard_user
 * @version    SVN: $Id: sfGuardUserForm.class.php 24560 2009-11-30 11:05:31Z fabien $
 */
class sfGuardUserForm extends sfGuardUserAdminForm
{
  public function configure()
  {
    parent::configure();
    
    $this->validatorSchema['password']->setOption('required', true);
    $this->validatorSchema['password'] = new sfValidatorAnd(
                    array(
                        $this->validatorSchema['password'],
                        new sfValidatorString(),
                    ), array(),
                    array(
                        'required' => 'La clave es requerida.',
                        'invalid' => 'La clave no es v&aacute;lida.',
                    )
    );
    $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again', array(), array('invalid' => 'Las claves deben ser iguales.')));

    unset(
      $this['last_login'],
      $this['created_at'],
      $this['salt'],
      $this['algorithm'],
//      $this['is_active'],
      $this['is_super_admin'],
//      $this['sf_guard_user_group_list'],
      $this['sf_guard_user_permission_list']
    );
    
    $this->widgetSchema->setLabels(
      array(
        'username' => 'C&oacute;digo',
        'password' => 'Clave',
        'password_again' => 'Confirmar',
        'is_active' => 'Activo',
        'sf_guard_user_group_list' => 'Grupo',
      )
    );
  }
}